#ifndef PARSERTHEATER_H
#define PARSERTHEATER_H


//----------------------------------------------------------------------------//
// I N C L U D E   Q T                                                        //
//----------------------------------------------------------------------------//
#include <QObject>


//----------------------------------------------------------------------------//
// I N C L U D E   P R O J E C T                                              //
//----------------------------------------------------------------------------//
#include "wget.h"
#include "theater.h"


//----------------------------------------------------------------------------//
// M A C R O S                                                                //
//----------------------------------------------------------------------------//


//----------------------------------------------------------------------------//
// T Y P E S   &   D E F I N I T I O N S                                      //
//----------------------------------------------------------------------------//
typedef enum
{
  PARSER_THEATER_OK,
  PARSER_THEATER_NOK,
  PARSER_THEATER_TIMEOUT
} ParserTheaterStatus_t;


//----------------------------------------------------------------------------//
// C L A S S   D E C L A R A T I O N                                          //
//----------------------------------------------------------------------------//
class ParserTheater : public QObject
{
    Q_OBJECT
  public:
    //------------------------------------------------------------------------//
    // C O N T R U C T O R S                                                  //
    //------------------------------------------------------------------------//
    ParserTheater(QObject *parent = 0);


    //------------------------------------------------------------------------//
    // P U B L I C   M E T H O D S   D E C L A R A T I O N                    //
    //------------------------------------------------------------------------//
    bool requestParseTheater(QString url);
    void setTheatersUrl(QString url);


    //------------------------------------------------------------------------//
    // P U B L I C   A T T R I B U T E S   D E C L A R A T I O N              //
    //------------------------------------------------------------------------//
    QList<Theater *> Theaters;


  signals:
    //------------------------------------------------------------------------//
    // S I G N A L S                                                          //
    //------------------------------------------------------------------------//
    void PageRequested(void);
    void pageReceived(void);


  private:
    //------------------------------------------------------------------------//
    // P R I V A T E   M E T H O D S   D E C L A R A T I O N                  //
    //------------------------------------------------------------------------//
    ParserTheaterStatus_t parsePage(Wget &);


    //------------------------------------------------------------------------//
    // P R I V A T E   A T T R I B U T E S   D E C L A R A T I O N            //
    //------------------------------------------------------------------------//
    QString TheatersUrl;
    int TimeSameMin;
    int TimeSameMax;
    int TimeDiffMin;
    int TimeDiffMax;
    int Timeout;
};


#endif // PARSERTHEATER_H
